package cn.com.surker.oa.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 供应商
 * </p>
 *
 * @author admin
 * @since 2022-10-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OaSupplier implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 简称
     */
    private String name;

    /**
     * 全称
     */
    private String fullName;

    /**
     * 法人代表
     */
    private String legal;

    /**
     * 联系方式
     */
    private String phone;

    /**
     * 联系地址
     */
    private String address;

    /**
     * 状态(0:启用1:禁用)
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

    /**
	 * 工厂ID,改为从子标关联查询
     */
	@TableField(exist = false)
	private Long orgId;

    /**
	 * 工厂ID,改为从子标关联查询
     */
	@TableField(exist = false)
	private String orgName;

	/**
	 * 类型,和erp的同步,为站点类型
	 */
	@TableField(exist = false)
	private Integer type;

    /**
     * 供应商code码
     */
    private String code;

	/**
	 * 供应商关联的站点
	 */
	@TableField(exist = false)
	private List<OaSupplierOrg> oaOrgList;

	/**
	 * erp主键ID
	 */
	@Deprecated
    private Integer erpId;

	/**
	 *初始金额时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
	private Date initialDate;

	/**
	 * 结算初始金额
	 */
	private Double initialAmount;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    public OaSupplier(){};

    public OaSupplier(String name, String fullName, String legal, String phone, Integer type, String address,
                      Integer status, String remark, Long orgId, String orgName, String code, Integer erpId,
                      Date createTime) {
        this.name = name;
        this.fullName = fullName;
        this.legal = legal;
        this.phone = phone;
        this.type = type;
        this.address = address;
        this.status = status;
        this.remark = remark;
        this.orgId = orgId;
        this.orgName = orgName;
        this.code = code;
        this.erpId = erpId;
        this.createTime = createTime;
    }
}
